import 'package:cbec_app/generated/json/base/json_field.dart';
import 'package:cbec_app/generated/json/superior_special_price_entity.g.dart';
import 'dart:convert';
import 'content_data.dart';
export 'package:cbec_app/generated/json/superior_special_price_entity.g.dart';

@JsonSerializable()
class SuperiorSpecialPriceEntity extends ContentData {
  @JSONField(name: "countdown_text_color")
  String? countdownTextColor = '';
  @JSONField(name: "more_btn_style")
  int? moreBtnStyle = 0;
  @JSONField(name: "page_margin_top")
  int? pageMarginTop = 0;
  @JSONField(name: "display_scale")
  String? displayScale = '';
  @JSONField(name: "image_fill_style")
  String? imageFillStyle = '';
  @JSONField(name: "mask_color")
  String? maskColor = '';
  @JSONField(name: "countdown_margin_left")
  int? countdownMarginLeft = 0;
  @JSONField(name: "corner_mark_type")
  String? cornerMarkType = '';
  @JSONField(name: "text_align_type")
  String? textAlignType = '';
  @JSONField(name: "show_corner_mark")
  bool? showCornerMark = false;
  @JSONField(name: "bg_image")
  SuperiorSpecialPriceBgImage? bgImage;
  String? uuid = '';
  @JSONField(name: "page_margin_bottom_2")
  int? pageMarginBottom2 = 0;
  @JSONField(name: "activity_name_color")
  String? activityNameColor = '';
  @JSONField(name: "text_style_type")
  String? textStyleType = '';
  String? price = '';
  @JSONField(name: "more_btn_color")
  String? moreBtnColor = '';
  @JSONField(name: "page_margin_right")
  int? pageMarginRight = 0;
  @JSONField(name: "sub_entry")
  List<SuperiorSpecialPriceSubEntry>? subEntry = [];
  @JSONField(name: "goods_margin_left_2")
  int? goodsMarginLeft2 = 0;
  int? per = 0;
  bool? bottomrds = false;
  @JSONField(name: "goods_margin_iner")
  int? goodsMarginIner = 0;
  @JSONField(name: "page_margin_bottom")
  int? pageMarginBottom = 0;
  @JSONField(name: "countdown_bg_color")
  String? countdownBgColor = '';
  @JSONField(name: "countdown_margin_top")
  int? countdownMarginTop = 0;
  @JSONField(name: "size_type")
  String? sizeType = '';
  @JSONField(name: "page_margin_top_2")
  int? pageMarginTop2 = 0;
  @JSONField(name: "show_count_down")
  String? showCountDown = '';
  @JSONField(name: "title_color")
  String? titleColor = '';
  @JSONField(name: "more_btn_text")
  String? moreBtnText = '';
  String? automatic = '';
  @JSONField(name: "countdown_margin_bottom")
  int? countdownMarginBottom = 0;
  @JSONField(name: "price_color")
  String? priceColor = '';
  @JSONField(name: "border_radius_type")
  String? borderRadiusType = '';
  @JSONField(name: "goods_margin")
  int? goodsMargin = 0;
  @JSONField(name: "page_margin_left")
  int? pageMarginLeft = 0;
  @JSONField(name: "more_show")
  String? moreShow = '';
  int? bdr = 0;
  @JSONField(name: "oldprice_color")
  String? oldpriceColor = '';
  @JSONField(name: "bg_color")
  String? bgColor = '';
  @JSONField(name: "show_title")
  String? showTitle = '';
  @JSONField(name: "corner_mark_image")
  String? cornerMarkImage = '';

  SuperiorSpecialPriceEntity() {
    type = 'limitdiscount01';
  }

  factory SuperiorSpecialPriceEntity.fromJson(Map<String, dynamic> json) => $SuperiorSpecialPriceEntityFromJson(json);

  @override
  Map<String, dynamic> toJson() => $SuperiorSpecialPriceEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  ContentData fromJson(Map<String, dynamic> json) {
    return SuperiorSpecialPriceEntity.fromJson(json);
  }
}

@JsonSerializable()
class SuperiorSpecialPriceBgImage {
  @JSONField(name: "attachment_url")
  String? attachmentUrl = '';

  SuperiorSpecialPriceBgImage();

  factory SuperiorSpecialPriceBgImage.fromJson(Map<String, dynamic> json) => $SuperiorSpecialPriceBgImageFromJson(json);

  Map<String, dynamic> toJson() => $SuperiorSpecialPriceBgImageToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class SuperiorSpecialPriceSubEntry {
  int? orderMoney = 0;
  int? pageSize = 0;
  int? orderNum = 0;
  int? targetType = 0;
  String? remark = '';
  String? marketingId = '';
  int? pageNum = 0;
  String? sid = '';
  String? unitType = '';
  String? activityId = '';
  String? shopNames = '';
  String? activityDate = '';
  int? payNum = 0;
  String? name = '';
  int? unitTypeValue = 0;
  String? activityDiscountId = '';
  String? targetTypeName = '';
  String? syncOnline = '';
  int? status = 0;

  SuperiorSpecialPriceSubEntry();

  factory SuperiorSpecialPriceSubEntry.fromJson(Map<String, dynamic> json) => $SuperiorSpecialPriceSubEntryFromJson(json);

  Map<String, dynamic> toJson() => $SuperiorSpecialPriceSubEntryToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
